#!/usr/bin/perl

use 5.010;
use utf8;
use strict;

sub greet {
	state @old_names;
	my $now_name = $_[0];
	print "Hello $now_name !";
	if ( @old_names) {
		print "I\'v seen: ";
		foreach (@old_names) {
			print "$_ ";
		}
		print "\n";
	} else {
		print "You are the first one here!\n"
	}
	push @old_names, $now_name;
}

greet "Fred";
greet "Barney";
greet "Wilma";
greet "Betty";